/*统一管理api接口*/
import {
	get,
	post
} from './http'
export default {
	name: 'api',
	/* 登陆注册 */
	login: (account, password) => post(`/user/login?username=${account}&password=${password}`),

	fistLogin: account => get(`/user/fistLogin/${account}`),

	hobby: hobbies => post('/user/hobby', hobbies),

	register: parm => post('/user/register', parm),

	onLine: uid => get(`/user/onLine/${uid}`),

	offLine: uid => get(`/user/signLogout/${uid}`),

	/* 随手记 */
	showNote: uid => get(`/note/show/${uid}`),

	addNote: parm => post('/note/add', parm),

	updateNote: parm => post('/note/update', parm),

	deleteNote: id => get(`/note/delete/${id}`),
	

	//草稿
	showDraft: uid => get(`/note/draft/show/${uid}`),

	addDraft: parm => post('/note/draft/add', parm),

	updateDraft: parm => post('/note/draft/update', parm),

	deleteDraft: id => get(`/note/draft/delete/${id}`),

	/* 日历 */
	//获取每个月所有的行程
	showMonthRecord: (uid, ym) => get(`/record/month/show/${uid}/${ym}`),

	//更新当天主要内容
	updateMonthRecord: parm => post('/record/month/update', parm),

	//展示当天详情
	showRecord: parm => post('/record/date/show', parm),

	//更新内容
	updateRecord: parm => post('/record/date/update', parm),

	//删除内容
	deleteReocrd: id => get(`/record/date/delete/${id}`),
	/* 删除接口好像有点问题 */


	/* 好友 */
	showFriends: uid => get(`/friend/show/${uid}`),

	searchFriends: (uid,name) => get(`/friend/search/${uid}/${name}`),

	addFriend: (uid, fid) => get(`/friend/add/${uid}/${fid}`),
	
	updateIntr: parm => post('/user/update/introduce', parm),
	
	updateHeadImg: parm => post('/user/update/portrait', parm),
	
	//好友排行榜
	frankinglist:(uid) => get(`/friend/frankinglist/${uid}`),
	
	//总排行榜
	rankinglist:() => get(`friend/rankinglist`),
	
	//推荐好友
	recommend:(uid) => get(`/friend/recommend/${uid}`),

	/* 番茄钟 */
	tomatoStart: parm => post('/tomato/start', parm),

	tomatoEnd: id => get(`/tomato/end/${id}`),

	getTomato: uid => get(`/tomato/time/${uid}`),
	// 路径参数封装
	//   Api: p => post('/'+ p),
	
	/* 上传图片 */
	uploadImg: parm => post('http://upload.qiniup.com/', parm),
	// 多参数封装
	//   Api : (p, q) => post('/' + p + "/" + q),
}
